package TransactionFactory

import (
	"SalaryPayment/TransactionImplementation"
	"reflect"
)

type ModelFactory struct {
}

func (m ModelFactory) CreateModelImplementation(classname string) reflect.Value {
	return reflect.New(assertType[classname])
}

var assertType map[string]reflect.Type

func init() {
	assertType["AddCommissionEmployee"] = reflect.TypeOf(TransactionImplementation.AddCommissionEmployee{})
	assertType["AddHourlyEmployee"] = reflect.TypeOf(TransactionImplementation.AddHourlyEmployee{})
	// 创建ModelImplementation中其他类型的映射
	// golang做不到向C#中那样根据字符串创建类型，只能通过这种方式来实现动态创建
	// transactionImplementation同理
	// 太多了不写了
}
